<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
	</head>
	<body>
		<script type="text/javascript">
			window.onload = function(){
				var a = 4, b = 8, c = 5;
				
				
				function bJiao(num1, num2, num3){
					var arr = [num1, num2, num3],
						tamp = 0;
					for (var key in arr){
						if (arr[key] > tamp)
						tamp = arr[key]
					}
					return tamp;
					
					// arr.sort(function(a, b){
					// 	return a - b;
					// })
					
					// return arr[arr.length-1];
				}
				var num = bJiao(a, b, c);
				console.log(num);
				
				// if (a > b){
				// 	if (a > c){
				// 		console.log(a);
				// 	}else{
				// 		console.log(c);
				// 	}
				// }else if (b > c){
				// 	console.log(b);
				// }else{
				// 	console.log(c);
				// }
			}
		</script>
	</body>
</html>
